library ieee;
use ieee.std_logic_1164.all;
package element_pack_typeclass is
type Element is class
class attribute Value1: integer;
class attribute Value2: integer;
impure function get_value1 return integer;
impure function get_value2 return integer;
impure function equal(Other: Element'CLASS) return boolean;
end class Element;
type Element is class body
impure function get_value1 return integer is
begin
return Value1;
end;
impure function get_value2 return integer is
begin
return Value2;
end;
impure function equal(Other: Element'CLASS) return boolean is
begin
return ((Value1=Other.get_value1) and
(Value2=Other.get_value2));
end;
|